package com.cloud.shopping.search.feign;

import com.cloud.shopping.search.model.SkuEs;
import com.cloud.shopping.tool.RespResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author John.Zhang
 * @version Id: SkuSearchFeign, v 0.1 2020/12/31 10:50 ZhiYong Exp $
 */
@FeignClient(value = "shopping-search")
public interface SkuSearchFeign {

    /**
     * 商品搜索
     * @param searchMap searchMap
     * @return RespResult
     */
    @GetMapping("/search")
    RespResult<Map<String,Object>> search(@RequestParam(required = false)Map<String,Object> searchMap);


    /**
     * 增加索引
     *
     * @param skuEs skuEs
     * @return RespResult
     */
    @PostMapping(value = "/search/add")
    RespResult add(@RequestBody SkuEs skuEs);

    /**
     * 删除索引
     *
     * @param id id
     * @return RespResult
     */
    @DeleteMapping(value = "/search/delete/{id}")
    RespResult delete(@PathVariable(value = "id") String id);

}
